home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 8
/
The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO
/
g_quake
/
compv09b.zip
/
C.BAT
< prev
next >
Wrap
DOS Batch File
|
1996-09-27
|
5KB
|
250 lines
@echo off
:start
if "%1"=="" goto noparams
if "%1"=="-novis" goto novis
if "%1"=="-NOVIS" goto novis
if "%1"=="-nolight" goto nolight
if "%1"=="-NOLIGHT" goto nolight
if "%1"=="-noqbsp" goto noqbsp
if "%1"=="-NOQBSP" goto noqbsp
if "%1"=="vis" goto vis
if "%1"=="VIS" goto vis
if "%1"=="light" goto light
if "%1"=="LIGHT" goto light
if "%1"=="qbsp" goto qbsp
if "%1"=="QBSP" goto qbsp
goto compile
:noparams
if "%compiled%"=="yes" goto end
echo.
echo C needs at least one file name to work properly. Read c.txt for extra details.
echo.
goto end
:novis
set vis=off
shift
goto start
:nolight
set light=off
shift
goto start
:noqbsp
set qbsp=off
shift
goto start
:vis
if "%vis%"=="off" goto viserr_off
if "%vu%"=="on" goto viserr_set
set vis=>>nul
set vu=on
:vis_test
shift
if "%1"=="-level" goto vis_level
if "%1"=="-LEVEL" goto vis_level
if "%1"=="-threads" goto vis_threads
if "%1"=="-THREADS" goto vis_threads
if "%1"=="-fast" goto vis_fast
if "%1"=="-FAST" goto vis_fast
if "%1"=="-v" goto vis_v
if "%1"=="-V" goto vis_v
goto start
:vis_level
shift
echo %vis% |find "-fast" >>nul
if errorlevel 1 goto vis_level_go
if errorlevel 0 goto visfast_err
:vis_level_go
if "%1"=="1" set l=1
if not "%1"=="1" set s=1
if "%1"=="2" set l=2
if not "%1"=="2" set s=2
if "%1"=="3" set l=3
if not "%1"=="3" set s=3
if "%1"=="4" set l=4
if not "%1"=="4" set s=4
if s=4 goto viserr
set vis=%vis% -level %s%
goto vis_test
:vis_threads
shift
if "%1"=="1" set vl=1
if not "%1"=="1" set vs=1
if "%1"=="2" set vl=2
if not "%1"=="2" set vs=2
if "%1"=="3" set vl=3
if not "%1"=="3" set vs=3
if "%1"=="4" set vl=4
if not "%1"=="4" set vs=4
if vs=4 goto viserr
set vis=%vis% -threads %vl%
goto vis_test
:vis_fast
set vis=%vis% -fast
goto vis_test
:vis_v
set vis=%vis% -v
goto vis_test
:viserr_set
echo.
echo You've already SET vis! Only issue commands once, otherwise they'll smeg up.
echo.
goto end
:viserr_off
echo.
echo You've already turned OFF vis! Make up your mind... ;)
echo.
goto end
:visfast_err
echo.
echo You can either specify "vis -fast" or "vis -level[1-4]", not both.
echo.
goto end
:viserr
echo.
echo Invalid VIS command! Look over the command line you issued, and correct it!
echo.
goto end
:light
if "%light%"=="off" goto lighterr_off
if "%lu%"=="on" goto lighterr_set
if not "%lu%"=="on" set light=>>nul
set lu=on
:light_test
shift
if "%1"=="-threads" goto light_threads
if "%1"=="-extra" goto light_extra
goto start
:light_threads
shift
if "%1"=="1" set ll=1
if not "%1"=="1" set ls=1
if "%1"=="2" set ll=2
if not "%1"=="2" set ls=2
if "%1"=="3" set ll=3
if not "%1"=="3" set ls=3
if "%1"=="4" set ll=4
if not "%1"=="4" set ls=4
if ls=4 goto lighterr
set light=%light% -threads %ll%
goto light_test
:light_extra
set light=%light% -extra
goto light_test
:lighterr_off
echo.
echo You've already turned OFF light! Make up your mind... ;)
echo.
goto end
:lighterr_set
echo.
echo You've already SET light! Only issue commands once, otherwise they'll smeg up.
echo.
goto end
:lighterr
echo.
echo Invalid LIGHT command! Look over the command line you issued, and correct it!
echo.
goto end
:qbsp
if "%qbsp%"=="on" set qbsp=>>nul
if "%qbsp%"=="off" goto qbsperr_off
if "%qu%"=="on" goto qbsperr_set
set qu=on
goto qtest
:qbsp_test
shift
:qtest
if "%1"=="-draw" goto qbsp_draw
if "%1"=="-notjunc" goto qbsp_notjunc
if "%1"=="-nofill" goto qbsp_nofill
if "%1"=="-noclip" goto qbsp_noclip
if "%1"=="-onlyents" goto qbsp_onlyents
if "%1"=="-verbose" goto qbsp_verbose
if "%1"=="-usehulls" goto qbsp_usehulls
if "%1"=="-proj" goto qbsp_proj
goto start
:qbsp_draw
echo %qbsp% |find "-draw"
if errorlevel 1 goto qbsperr_multopt
set qbsp=%qbsp% -draw
goto qbsp_test
:qbsp_notjunc
echo %qbsp% |find "-notjunc"
if errorlevel 1 goto qbsperr_multopt
set qbsp=%qbsp% -notjunc
goto qbsp_test
:qbsp_nofill
echo %qbsp% |find "-nofill"
if errorlevel 1 goto qbsperr_multopt
set qbsp=%qbsp% -nofill
goto qbsp_test
:qbsp_noclip
echo %qbsp% |find "-noclip"
if errorlevel 1 goto qbsperr_multopt
set qbsp=%qbsp% -noclip
goto qbsp_test
:qbsp_onlyents
echo %qbsp% |find "-onlyents"
if errorlevel 1 goto qbsperr_multopt
set qbsp=%qbsp% -onlyents
goto qbsp_test
:qbsp_verbose
echo %qbsp% |find "-verbose"
if errorlevel 1 goto qbsperr_multopt
set qbsp=%qbsp% -verbose
goto qbsp_test
:qbsp_usehulls
echo %qbsp% |find "-usehulls"
if errorlevel 1 goto qbsperr_multopt
set qbsp=%qbsp% -usehulls
goto qbsp_test
:qbsp_proj
echo %qbsp% |find "-proj"
if errorlevel 1 goto qbsperr_multopt
shift
set qbsp=%qbsp% -proj %1
goto qbsp_test
:qbsperr_multopt
echo.
echo Only set options once! Otherwise, they'll (you guessed it) smeg up!!
echo.
goto end
:qbsperr_set
echo.
echo You've already SET qbsp! Only issue commands once, otherwise they'll smeg up.
echo.
goto end
:qbsperr_off
echo.
echo You've already turned OFF qbsp! Make up your mind... ;)
echo.
goto end
:compile
set compiled=yes
if not "%qbsp%"=="off" qbsp %qbsp% %1
if not "%light%"=="off" light %light% %1
if not "%vis%"=="off" vis %vis% %1
shift
goto start
:end
set qbsp=>>nul
set light=>>nul
set vis=>>nul
set qu=>>nul
set lu=>>nul
set vu=>>nul
set vl=>>nul
set vs=>>nul
set ll=>>nul
set ls=>>nul
set l=>>nul
set s=>>nul
set compiled=>>nul